<%= form_for(@lecture) do |f| %>
    <% if @lecture.errors.any? %>
        <div id="error_explanation">
          <h2><%= pluralize(@lecture.errors.count, "error") %> prohibited this lecture from being saved:</h2>

          <ul>
            <% @lecture.errors.full_messages.each do |msg| %>
                <li><%= msg %></li>
            <% end %>
          </ul>
        </div>
    <% end %>

    <div class="field">
      <%= f.label :title %><br />
      <%= f.text_field :title %>
    </div>
    <div class="field" style="width:220px">
      <%= f.label :ects %><br />
      <%= f.select :ects, options_for_select([[""], ["5"], ["4"], ["3"], ["2"]]) %>
    </div>
    <div class="field">
      <%= f.label :track %><br />
      <%= f.text_field :track %>
    </div>
    <div class="field">
      <%= f.label :code %><br />
      <%= f.text_field :code %>
    </div>
    <div class="field" style="width:220px">
      <%= f.label :semester %><br />
      <%= f.select :semester, options_for_select([[""], ["Fall"], ["Autumn"], ["Summer"]]) %>
    </div>
    <div class="field" style="width:220px">
      <%= f.label :location %><br />
      <%= f.select :location, options_for_select([[""], ["Fribourg"], ["Neuchatel"], ["Bern"]]) %>
    </div>
    <div class="field" style="width:220px">
      <%= f.label :language %><br />
      <%= f.select :language, options_for_select([[""], ["English"], ["French"], ["German"]]) %>
    </div>



    <div class="field">
      <%= f.label :has_exercise %><br />

      <%= f.radio_button :has_exercise, "1" %><a>Yes</a>
      <%= f.radio_button :has_exercise, "0" %><a>No</a>
    </div>

    <div class="field">
      <%= f.label :who_gives_the_lecture %><br />

      <select name="prof" style="width:220px" >
        <option></option>
        <% Professor.all.each do |prof| %>
            <option value='<%= prof.id %>'>
              <%= prof.first_name %>
              <%= prof.last_name %>
            </option>
        <% end %>
      </select>
    </div>

    <span class="projectSection"> New Professor: </span>
    <div class="projectContainer">
      <div id="showProjectArrow">
        <img src="../assets/arrowDown.png"></img>
      </div>
      <div class="projectContent">
        <div class="field">
          <a>First Name</a>
          <input type="text" name="first" id="first" />
        </div>
        <div class="field">
          <a>Last Name</a>
          <input type="text" name="last" id="last" />
        </div>
        <div class="field">
          <a>Department:</a>
          <input type="text" name="dep" id="dep" />
        </div>
      </div>
    </div>

    <div class="actions" class="shinyButton">
      <%= f.submit :class => "shinyButton" %>
    </div>
<% end %>
<script>
    var $jQuery = jQuery.noConflict();
    $jQuery("div#showProjectArrow").click(function() {
        $jQuery(this).next(".projectContent").toggle('fast');
    });
</script>
